package View;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.geom.AffineTransform;
import java.io.File;

import javax.swing.JPanel;

public class Display extends JPanel {
  
	String fileName;
	Image img;
	
	public Display(String fileName) {
	    
		setBackground(Color.white);
		System.out.println();
		
		File dir1 = new File (".");
		try {
			this.fileName=dir1.getCanonicalPath()+"\\"+"src"+"\\"+"Images"+"\\"+fileName;
		}
		catch(Exception e) {
			e.printStackTrace();
		}
  }
	
  public void paint(Graphics g) {
    try {
      Graphics2D g2D;
      g2D = (Graphics2D) g;
     // g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      
      img= getToolkit().getImage(fileName);
      //AffineTransform aTran = new AffineTransform();
      //aTran.translate(50.0f, 20.0f);
      //g2D.transform(aTran);
      g2D.drawImage(img, new AffineTransform(), this);
    } 
    catch (Exception e) {
    }
  }
    
}